<template>
    <div v-if="tkIsShow">
        <div class="zhezhao"></div>
        <div class="tankuang">
            <div class="tk_title">{{ title }}</div>
            <img src="../assets/icon-close.png" class="tk_close" @click="closeTk">
            <div class="tk_content">
                <el-timeline reverse="true">
                    <el-timeline-item
                    v-for="(activity, index) in tableData"
                    :key="index"
                    :timestamp="activity.scanTime">
                    {{activity.trackingDesc}}
                    </el-timeline-item>
                </el-timeline>
            </div>
        </div>
    </div>
</template>
<script>
export default {
  data() {
    return {
        tkIsShow:false,
        title:"",
        orderId:'',
        tableData:[]
    };
  },
  methods: {
    __init(trackingNo,supplierId) {
      this.orderId=trackingNo;
      this.getWuliu(trackingNo,supplierId);
    },
    getWuliu(trackingNo,supplierId){
      var url="userApi/queryTrajectory";
      var params={
        trackingNo:trackingNo,
        supplierId:supplierId
      }
      this.$post(url, params).then((res) => {
        if(res.code==0&&res.data.length>0){
          this.tableData=res.data
        }
      });
    },
    closeTk(){
        this.tkIsShow = false;
    }
  }
}
</script>
<style scoped lang="scss">
  .zhezhao{
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0.2;
    top: 0;
    left: 0;
    z-index: 100;
  }
  .tankuang{
    position: fixed;
    width: 36%;
    height: 440px;
    background-color: #fff;
    top: 15%;
    left: 32%;
    z-index: 101;
    border-radius: 5px;
  }
  .tk_title{
    font-size: 17px;
    margin: 15px 0;
    height: 25px;
    line-height: 25px;
  }
  .tk_content{
    width: 90%;
    margin-left: 5%;
    height: calc(100% - 55px);
    text-align: left;
    overflow-y: auto;
  }
  .tk_close{
    position: absolute;
    width: 16px;
    height: 16px;
    top: 18px;
    right: 20px;
    
  }
</style>